package com.zjitc;

import com.zjitc.config.JavaConfigDome1;
import com.zjitc.config.JavaConfigDome2;
import com.zjitc.obj.Teacher;
import com.zjitc.obj.User;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;

/**
 * Create by IntelliJ IDEA
 *
 * @author: jsonor
 * @date-Time: 2018/3/6 15:51
 * @description:
 */
public class App3 {

  public static void main(String[] args) {
    ApplicationContext context=new AnnotationConfigApplicationContext(JavaConfigDome1.class);
    User u1 = context.getBean("u1", User.class);
    System.out.println(u1);
    ApplicationContext context1=new AnnotationConfigApplicationContext(JavaConfigDome2.class);
    Teacher t1 = context1.getBean("t1", Teacher.class);
    System.out.println(t1);
  }

}
